#!/bin/sh
# echo 'build the java project'
# ant
# echo "start javah -classpath ./bin/   javac.main"
# javah -classpath ./bin/   javac.main
# echo "start gfortran -shared -fPIC -m64 -o libcssfortran.so fortran_sample.f90 ......"
# gfortran -shared -fPIC -m64 -o libcssfortran.so fortran_sample.f90
# echo "start g++ -o libbridge.so -shared -fPIC -m64 -L. -ledbms_api_64  -lcssfortran c.cpp "
# g++ -o libbridge.so -shared -fPIC -m64 -L. -ledbms_api_64  -lcssfortran c.cpp
# echo "ok!"
# java -cp ./bin/ javac.main

echo 'build the java project'
ant
echo "start javah -classpath ./bin/  nc2db.Array2db.."
javah -classpath ./bin/  nc2db.Array2db
echo "start gfortran -shared -fPIC -m64 -o libwritedb.so write_to_db.f90 day2db.f90 ......"
gfortran -shared -fPIC -m64 -o libwritedb.so write_to_db.f90 day2db.f90
echo "start g++ -o libjava2db.so -shared -fPIC -m64  java2db.cpp ......"
g++ -o libjava2db.so -shared -fPIC -m64 -L. -ledbms_api_64  -lwritedb java2db.cpp
echo "start java -cp ./lib/commons-io.jar:./lib/jdom.jar:./lib/dom4j-1.6.1.jar:./bin/  test.main.."
java -cp ./lib/commons-io.jar:./lib/jdom.jar:./lib/dom4j-1.6.1.jar:./bin/  test.main
#java -cp ./lib/commons-io.jar:./lib/jdom.jar:./lib/dom4j-1.6.1.jar:./bin/  nc2db.ncArray